import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '考试名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '考试类型',
    align: "center",
    dataIndex: 'openType',
  },
  {
    title: '开始时间',
    align: "center",
    dataIndex: 'startTime'
  },
  {
    title: '结束时间',
    align: "center",
    dataIndex: 'endTime'
  },
  // {
  //   title: '是否限时',
  //   align: "center",
  //   dataIndex: 'timeLimit'
  // },
  {
    title: '总时长（分钟）',
    align: "center",
    dataIndex: 'totalTime'
  },
  {
    title: '总分数',
    align: "center",
    dataIndex: 'totalScore'
  },
  {
    title: '及格分数',
    align: "center",
    dataIndex: 'passScore'
  },
  {
    title: '考试人员',
    align: "center",
    dataIndex: 'examPerson'
  },
  {
    title: '考试状态',
    align: "center",
    dataIndex: 'status'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "考试名称",
    field: 'name',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "1公开2部门3定员",
    field: 'openType',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    label: "考试状态",
    field: 'status',
    component: 'Input',
    colProps: { span: 6 },
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '考试名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '1公开2部门3定员',
    field: 'openType',
    component: 'Input',
  },
  {
    label: '考试状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '是否限时',
    field: 'timeLimit',
    component: 'Input',
  },
  {
    label: '开始时间',
    field: 'startTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '结束时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '总分数',
    field: 'totalScore',
    component: 'InputNumber',
  },
  {
    label: '总时长（分钟）',
    field: 'totalTime',
    component: 'InputNumber',
  },
  {
    label: '及格分数',
    field: 'passScore',
    component: 'InputNumber',
  },
  {
    label: '考试人员',
    field: 'examPerson',
    component: 'Input',
  },
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

